home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form GraphMix
- BorderStyle = 1 'Fixed Single
- Caption = "Graph Sales Mix"
- ControlBox = 0 'False
- Height = 6030
- Left = 1515
- LinkTopic = "GraphMix"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5625
- ScaleWidth = 5385
- Top = 1470
- Width = 5505
- Begin GRAPH Graph1
- ColorData = GRAPHMIX.FRX:0000
- ExtraData = GRAPHMIX.FRX:0002
- FontFamily = GRAPHMIX.FRX:0004
- FontSize = GRAPHMIX.FRX:0008
- FontStyle = GRAPHMIX.FRX:0012
- GraphData = GRAPHMIX.FRX:0016
- GraphType = 2 '3D Pie
- Height = 4965
- LabelText = GRAPHMIX.FRX:001A
- Left = 135
- LegendText = GRAPHMIX.FRX:001C
- PatternData = GRAPHMIX.FRX:001E
- SymbolData = GRAPHMIX.FRX:0020
- TabIndex = 1
- Top = 585
- Width = 5160
- XPosData = GRAPHMIX.FRX:0022
- End
- Begin CommandButton Command1
- Caption = "Cancel"
- Height = 495
- Left = 4095
- TabIndex = 0
- Top = 45
- Width = 1215
- End
- Sub Command1_Click ()
- PrintCancelFlag = True
- End Sub
- Sub Form_Activate ()
- Unload SalesMix
- PrintRoutine
- End Sub
- Sub PrintRoutine ()
- t% = DoEvents()
- On Local Error GoTo ErrorRoutine
- PageNo% = 0
- TotalRetail& = 0
- TotalCost& = 0
- Printer.FontName = RTrim(CfgRec.FontName)
- Printer.FontSize = CfgRec.FontSize
- MaximumY& = (Printer.ScaleHeight - 1500)
- PrintingCancelFlag = False
- Print "Deli Menu System"
- Print "Calculating...Please Wait..."
- 'Begin First Pass
- 'This pass is to get the totals before printing the report.
- t% = DoEvents()
- FirstSalesMix
- If SalesMixSt% <> 0 Then
- MsgUnknownSalesMixError
- End If
- Do
- ExtCost& = 0
- ExtRetail& = 0
- RecipeCost = 0
- RecipeRec.RecNo = SalesMixRec.RecNo
- ReadRecipe
- 'Get lines of ingredients
- RecipeDetRec.RecDetKey = RecipeRec.RecNo + String$(15, "0")
- GetGERecipeDet
- If RecipeDetSt% <> 9 And RecipeDetSt% <> 0 Then
- MsgUnknownRecipeDetError
- GoTo ExitProgram
- End If
- Do Until RecipeDetSt% <> 0 Or RecipeDetRec.RecDetKey > RecipeRec.RecNo + String$(15, "Z")
- IngredientRec.IngKey = Mid$(RecipeDetRec.RecDetKey, 7, 15)
- ReadIngredient
- If IngredientSt% = 0 Then
- PrIngred$ = Mid$(RecipeDetRec.RecDetKey, 7, 15)
- PrNoUnits# = RecipeDetRec.RecDetQty
- GoSub ProcessOneIngredient
- End If
- t% = DoEvents()
- NextRecipeDet
- Loop
- ExtRetail& = RecipeRec.RecRetail * SalesMixRec.ServingsSold
- UnitCost& = RecipeCost / RecipeRec.Servings
- ExtCost& = UnitCost& * SalesMixRec.ServingsSold
- TotalRetail& = TotalRetail& + ExtRetail&
- TotalCost& = TotalCost& + ExtCost&
- NextSalesMix
- t% = DoEvents()
- Loop Until SalesMixSt% <> 0 Or PrintCancelFlag = True
- DollarProfit@ = (TotalRetail& - (TotalCost& / 100)) / 100
- 'Begin Second Pass
- GoSub PrintHeading
- t% = DoEvents()
- FirstSalesMix
- If SalesMixSt% <> 0 Then
- MsgUnknownSalesMixError
- End If
- Do
- If Printer.CurrentY > MaximumY& Then
- Printer.NewPage
- GoSub PrintHeading
- End If
- ExtCost& = 0
- ExtRetail& = 0
- RecipeCost = 0
- RecipeRec.RecNo = SalesMixRec.RecNo
- ReadRecipe
- 'Get lines of ingredients
- RecipeDetRec.RecDetKey = RecipeRec.RecNo + String$(15, "0")
- GetGERecipeDet
- If RecipeDetSt% <> 9 And RecipeDetSt% <> 0 Then
- MsgUnknownRecipeDetError
- GoTo ExitProgram
- End If
- Do Until RecipeDetSt% <> 0 Or RecipeDetRec.RecDetKey > RecipeRec.RecNo + String$(15, "Z")
- IngredientRec.IngKey = Mid$(RecipeDetRec.RecDetKey, 7, 15)
- ReadIngredient
- If IngredientSt% = 0 Then
- PrIngred$ = Mid$(RecipeDetRec.RecDetKey, 7, 15)
- PrNoUnits# = RecipeDetRec.RecDetQty
- GoSub ProcessOneIngredient
- End If
- t% = DoEvents()
- NextRecipeDet
- Loop
- Printer.Print SalesMixRec.RecNo;
- Printer.Print Tab(8); RecipeRec.RecDesc;
- ExtRetail& = RecipeRec.RecRetail * SalesMixRec.ServingsSold
- Temp1$ = Format$((RecipeRec.RecRetail / 100), "##0.00")
- Temp1$ = String$(6 - Len(Temp1$), " ") + Temp1$
- Printer.Print Tab(40); Temp1$;
- UnitCost& = RecipeCost / RecipeRec.Servings
- ExtCost& = UnitCost& * SalesMixRec.ServingsSold
- Temp1$ = Format$((UnitCost& / 10000), "##0.0000")
- Temp1$ = String$(8 - Len(Temp1$), " ") + Temp1$
- Printer.Print Tab(48); Temp1$;
- Temp1$ = Format$(SalesMixRec.ServingsSold, "####0")
- Temp1$ = String$(5 - Len(Temp1$), " ") + Temp1$
- Printer.Print Tab(58); Temp1$;
- Temp1$ = Format$((ExtRetail& / 100), "#####0.00")
- Temp1$ = String$(9 - Len(Temp1$), " ") + Temp1$
- Printer.Print Tab(65); Temp1$;
- Temp1$ = Format$((ExtCost& / 10000), "#####0.0000")
- Temp1$ = String$(11 - Len(Temp1$), " ") + Temp1$
- Printer.Print Tab(76); Temp1$;
- Temp1$ = Format$(((ExtRetail& / 100) - (ExtCost& / 10000)), "#####0.00")
- Temp1$ = String$(9 - Len(Temp1$), " ") + Temp1$
- Printer.Print Tab(89); Temp1$;
- PctSales@ = (ExtRetail& / TotalRetail&) * 100
- Temp1$ = Format$(PctSales@, "###.00")
- Temp1$ = String$(6 - Len(Temp1$), " ") + Temp1$
- Printer.Print Tab(100); Temp1$;
- PctProfit@ = ((ExtRetail& - (ExtCost& / 100)) / (DollarProfit@ * 100)) * 100
- Temp1$ = Format$(PctProfit@, "###.00")
- Temp1$ = String$(6 - Len(Temp1$), " ") + Temp1$
- Printer.Print Tab(108); Temp1$
- NextSalesMix
- t% = DoEvents()
- Loop Until SalesMixSt% <> 0 Or PrintCancelFlag = True
- GoSub PrintTotals
- GoTo ExitProgram
- Exit Sub
- PrintHeading:
- PageNo% = PageNo% + 1
- Printer.Print "Projected Sales Mix Profitability Report"; Tab(55); Date$; Tab(85); "Page "; PageNo%
- Printer.Print Tab(66); "Extended Extended Dollar % of % of"
- Printer.Print "Recipe# Description"; Tab(40); "Retail Cost Sold Retail Cost Profit Sales Profit"
- Printer.Print String$(113, "-")
- Return
- ProcessOneIngredient:
- IngredientRec.IngKey = PrIngred$
- ReadIngredient
- CostPerUnit& = IngredientRec.IngCaseCost / IngredientRec.IngUnitsPerCase
- IngredientCost = (CostPerUnit& * PrNoUnits#)
- RecipeCost = RecipeCost + IngredientCost
- Return
- PrintTotals:
- Printer.Print String$(113, "-")
- PctProfit@ = ((TotalRetail& - (TotalCost& / 100)) / TotalRetail&) * 100
- Printer.Print "Total menu profit percent = "; Format$(PctProfit@, "##0.00"); "%";
- Temp1$ = Format$((TotalRetail& / 100), "#####0.00")
- Temp1$ = String$(9 - Len(Temp1$), " ") + Temp1$
- Printer.Print Tab(65); Temp1$;
- Temp1$ = Format$((TotalCost& / 10000), "#####0.0000")
- Temp1$ = String$(11 - Len(Temp1$), " ") + Temp1$
- Printer.Print Tab(76); Temp1$;
- Temp1$ = Format$(DollarProfit@, "#####0.00")
- Temp1$ = String$(9 - Len(Temp1$), " ") + Temp1$
- Printer.Print Tab(89); Temp1$
- Return
- ErrorRoutine:
- Resume ExitProgram
- ExitProgram:
- Printer.EndDoc
- Unload SalesMix
- End Sub
-